<?php	
include_once('parametros.php');	
	session_start();
	if (!empty($_SESSION['correo'])){
		$session=true;				
		$nomUsuario=$_SESSION['nomUsu'];		
		$usuRol=$_SESSION['usuRol'];								
		$ultAcceso=$_SESSION['ultAcc'];
		$usuEstado=$_SESSION['usuEst'];
		$session=$_SESSION['sessionId'];				
		$itemSession=$_SESSION['itemSession'];
		$codUsuario=$_SESSION['codUsuario'];																				
	}else{
		$session=false;
	}		
 if ($session==true){

 ?>
 <html>
<head>
<style>
a:link { text-decoration: none; color: #000000 }
a:active { text-decoration: none; color: #000000}
a:visited { text-decoration: none; color: #000000}
</style>
<script LANGUAGE="javascript">
<!--

var gEBI = (document.getElementById) ? true : false;
var da = (document.all) ? true : false;
var lay = (document.layers) ? true : false;

function Menu(ID)
 {
 	var ktgID = "ktg_" + ID;
 	var imgID = "img_" + ID;
 	
 	if (gEBI)
 	{
 		ktgID = document.getElementById(ktgID);
 		imgID = document.getElementById(imgID);
 		//alert("gEBI");
 	}
 	else
 	{
 		if (da)
 		{
 			ktgID = document.all(ktgID);
 			imgID = document.all(imgID);
 			//alert("da");
 		}
 		else
 		{
 			if (lay)
 			{
 				//alert("lay");
 				//KtgID = document.layers(ktgID);
 				//imgID = document.layers(imgID);
 			}
 			else
 			{
 				alert("Sorry, your browser does not support this page!");
 			}
 		}
 	}
 	if (gEBI || da)
 	{
		if (ktgID.style.display == "none")
 		{
 			ktgID.style.display = "block";
 			imgID.src = "imagenes/minus.gif";
 		}
 		else
 		{
 			ktgID.style.display = "none";
 			imgID.src = "imagenes/plus.gif";
 		} 	
 	}
 	else
 	{
 		if (document.layers["ktg_"+ID].visibility == "hide")
 		{
 			document.layers["ktg_"+ID].visibility = "show";
 		
 		}
 		else
 		{
 			document.layers["ktg_"+ID].visibility = "hide";
 		
 		}
 	}

 }

var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_nav6up = (is_nav && (is_major >= 5));
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie4up  = (is_ie && (is_major >= 4));

 //-->
</script> 

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></HEAD>
<html>
<BODY TEXT="#ccc" LINK="#000000" VLINK="#000000" ALINK="#F70404">

<font size="1" face="Verdana, Arial, Helvetica, sans-serif">

<span class="Menu">
<?php
if(substr($itemSession,0,1)==1){
?>
<IMG ID="img_1" SRC="imagenes/plus.gif" border='0' onClick='javascript: Menu(1);'>
<a href='#' class='Menu' onClick='javascript: Menu(1);'><B>ITEM 1</B></a><br>
<span id='ktg_1' style='display:none;'>
<table width="158" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="17">&nbsp;</td>
    <td width="16"><img src="imagenes/carta_enviada.jpg" width="22" height="22" border="0"></td>
    <td width="123">
		<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
			<a href="entrada.php?item=1&tipo=e" target="main">Enviados</a><br>
		</font>
	</td>
  </tr>
  <tr>
    <td width="17">&nbsp;</td>
    <td width="16"><img src="imagenes/carta_recibida.jpg" width="22" height="22" border="0"></td>
    <td width="123">
		<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
			<a href="entrada.php?item=1&tipo=r" target="main">Recibidos</a><br>
		</font>
	</td>
  </tr>  
</table>
</span>
<?php
}
if(substr($itemSession,1,1)==1){
?>
<IMG ID="img_2" SRC="imagenes/plus.gif" border='0' onClick='javascript: Menu(2);'>
<a href='#' class='Menu' onClick='javascript: Menu(2);'><B>ITEM 2</B></a><br>
<span id='ktg_2' style='display:none;'>
<table width="158" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="17">&nbsp;</td>
    <td width="16"><img src="imagenes/carta_enviada.jpg" width="22" height="22"  border="0"></td>
    <td width="123">
		<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
			<a href="entrada.php?item=2&tipo=e" target="main">Enviados</a><br>
		</font>
	</td>
  </tr>
  <tr>
    <td width="17">&nbsp;</td>
    <td width="16"><img src="imagenes/carta_recibida.jpg" width="22" height="22" border="0"></td>
    <td width="123">
		<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
			<a href="entrada.php?item=2&tipo=r" target="main">Recibidos</a><br>
		</font>
	</td>
  </tr>  
</table>
</span>
<?php
}
if(substr($itemSession,2,1)==1){
?>
<IMG ID="img_3" SRC="imagenes/plus.gif" border='0' onClick='javascript: Menu(3);'>
<a href='#' class='Menu' onClick='javascript: Menu(3);'><B>ITEM 3</B></a><br>
<span id='ktg_3' style='display:none;'>
<table width="158" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="17">&nbsp;</td>
    <td width="16"><img src="imagenes/carta_enviada.jpg" width="22" height="22"  border="0"></td>
    <td width="123">
		<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
			<a href="entrada.php?item=3&tipo=e" target="main">Enviados</a><br>
		</font>
	</td>
  </tr>
  <tr>
    <td width="17">&nbsp;</td>
    <td width="16"><img src="imagenes/carta_recibida.jpg" width="22" height="22" border="0"></td>
    <td width="123">
		<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
			<a href="entrada.php?item=3&tipo=r" target="main">Recibidos</a><br>
		</font>
	</td>
  </tr>  
</table>
</span>

<?php
}
if($usuRol==1){//administrador
?>
<IMG ID="img_4" SRC="imagenes/plus.gif" border='0' onClick='javascript: Menu(4);'>
	<a href='#' class='Menu' onClick='javascript: Menu(4);'><B>MANTENIMIENTOS</B></a><br>
<span id='ktg_4' style='display:none;'>
<table width="158" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="17">&nbsp;</td>
    <td width="16"><img src="imagenes/users.png" width="15" height="15" border="0"></td>
    <td width="123">
		<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
			<a href="entrada.php?item=Admin&tipo=1" target="main">Usuarios</a><br>
		</font>
	</td>
  </tr>

  <tr>
    <td width="17">&nbsp;</td>
    <td width="16"><img src="imagenes/item1.jpg" width="13" height="15" border="0"></td>
    <td width="123">
		<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
			<a href="entrada.php?item=Admin&tipo=2" target="main">Tipo de Cartas</a><br>
		</font>
	</td>
  </tr>  
    
</table>
</span>
<?php }?>
</span>
<HR WIDTH=100% size=1 COLOR="#000000">
</FONT>
</body>
</html>
<?php } 
?>